/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;

/**
 * ClassName: TransferOrderDetail <br/>
 * Function: 调拨单据明细 <br/>
 * date: 2018-11-08 14:02:55 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="transfer_order_details")
public class TransferOrderDetail extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 订单id
	@ManyToOne
    @JoinColumn(name="order_id")
	private TransferOrder order = null;

	// 物品id 
    @Column(name="material_id")
	private Long materialId = null;

	// 物品编号 
    @Column(name="no", length = 300)
	private String no = null;

	// 物品名称 
    @Column(name="name", length = 300)
	private String name = null;

	// 物品规格 
    @Column(name="spec", length = 300)
	private String spec = null;

	// 物品单位 
    @Column(name="unit", length = 300)
	private String unit = null;

	// 物品数量 
    @Column(name="count",scale=2)
	private Double count = null;

	// 物品单价 
    @Column(name="price",scale=2)
	private Double price = null;

	// 物品金额 
    @Column(name="amount",scale=2)
	private Double amount = null;
	// 物品条码
	@Column(name="code", length = 300)
	private String code = null;

    @Tolerate
	public TransferOrderDetail() {
		
	}
    @Tolerate
	public TransferOrderDetail(Long id){
    	super.setId(id);
    }

	public TransferOrder getOrder() {
		return order;
	}

	public void setOrder(TransferOrder order) {
		this.order = order;
	}

	/**
	 * 获取物品id
	 */
	public Long getMaterialId() {
		return this.materialId;
	}

    /**
     * 设置物品id
     */
	public TransferOrderDetail setMaterialId(Long materialId) {
		this.materialId = materialId;
		return this;
	}

	/**
	 * 获取物品编号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置物品编号
     */
	public TransferOrderDetail setNo(String no) {
		this.no = no;
		return this;
	}

	/**
	 * 获取物品名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置物品名称
     */
	public TransferOrderDetail setName(String name) {
		this.name = name;
		return this;
	}

	/**
	 * 获取物品规格
	 */
	public String getSpec() {
		return this.spec;
	}

    /**
     * 设置物品规格
     */
	public TransferOrderDetail setSpec(String spec) {
		this.spec = spec;
		return this;
	}

	/**
	 * 获取物品单位
	 */
	public String getUnit() {
		return this.unit;
	}

    /**
     * 设置物品单位
     */
	public TransferOrderDetail setUnit(String unit) {
		this.unit = unit;
		return this;
	}

	/**
	 * 获取物品数量
	 */
	public Double getCount() {
		return this.count;
	}

    /**
     * 设置物品数量
     */
	public TransferOrderDetail setCount(Double count) {
		this.count = count;
		return this;
	}

	/**
	 * 获取物品单价
	 */
	public Double getPrice() {
		return this.price;
	}

    /**
     * 设置物品单价
     */
	public TransferOrderDetail setPrice(Double price) {
		this.price = price;
		return this;
	}

	/**
	 * 获取物品金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置物品金额
     */
	public TransferOrderDetail setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
}
